<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>StandardDecryptor (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
    if (location.href.indexOf('is-external=true') == -1) {
        parent.document.title="StandardDecryptor (POI API Documentation)";
    }
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!--   -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/StandardDecryptor.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/poi/poifs/crypt/standard/EncryptionRecord.html" title="interface in org.apache.poi.poifs.crypt.standard"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../../org/apache/poi/poifs/crypt/standard/StandardEncryptionHeader.html" title="class in org.apache.poi.poifs.crypt.standard"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/poi/poifs/crypt/standard/StandardDecryptor.html" target="_top">FRAMES</a></li>
<li><a href="StandardDecryptor.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_top");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li><a href="#fields_inherited_from_class_org.apache.poi.poifs.crypt.Decryptor">FIELD</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!--   -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<p class="subTitle">org.apache.poi.poifs.crypt.standard</p>
<h2 title="Class StandardDecryptor" class="title">Class StandardDecryptor</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object</li>
<li>
<ul class="inheritance">
<li><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html" title="class in org.apache.poi.poifs.crypt">org.apache.poi.poifs.crypt.Decryptor</a></li>
<li>
<ul class="inheritance">
<li>org.apache.poi.poifs.crypt.standard.StandardDecryptor</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<hr>
<br>
<pre>public class <strong>StandardDecryptor</strong>
extends <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html" title="class in org.apache.poi.poifs.crypt">Decryptor</a></pre>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!--   -->
</a>
<h3>Field Summary</h3>
<ul class="blockList">
<li class="blockList"><a name="fields_inherited_from_class_org.apache.poi.poifs.crypt.Decryptor">
<!--   -->
</a>
<h3>Fields inherited from class&nbsp;org.apache.poi.poifs.crypt.<a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html" title="class in org.apache.poi.poifs.crypt">Decryptor</a></h3>
<code><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#DEFAULT_PASSWORD">DEFAULT_PASSWORD</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#info">info</a></code></li>
</ul>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!--   -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier</th>
<th class="colLast" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected </code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/poifs/crypt/standard/StandardDecryptor.html#StandardDecryptor(org.apache.poi.poifs.crypt.EncryptionInfo)">StandardDecryptor</a></strong>(<a href="../../../../../../org/apache/poi/poifs/crypt/EncryptionInfo.html" title="class in org.apache.poi.poifs.crypt">EncryptionInfo</a>&nbsp;info)</code>&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!--   -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/poifs/crypt/standard/StandardDecryptor.html#fillAndXor(byte[], byte)">fillAndXor</a></strong>(byte[]&nbsp;hash,
          byte&nbsp;fillByte)</code>&nbsp;</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static javax.crypto.SecretKey</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/poifs/crypt/standard/StandardDecryptor.html#generateSecretKey(java.lang.String, org.apache.poi.poifs.crypt.EncryptionVerifier, int)">generateSecretKey</a></strong>(java.lang.String&nbsp;password,
                 <a href="../../../../../../org/apache/poi/poifs/crypt/EncryptionVerifier.html" title="class in org.apache.poi.poifs.crypt">EncryptionVerifier</a>&nbsp;ver,
                 int&nbsp;keySize)</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.io.InputStream</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/poifs/crypt/standard/StandardDecryptor.html#getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode)">getDataStream</a></strong>(<a href="../../../../../../org/apache/poi/poifs/filesystem/DirectoryNode.html" title="class in org.apache.poi.poifs.filesystem">DirectoryNode</a>&nbsp;dir)</code>
<div class="block">Return a stream with decrypted data.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected int</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/poifs/crypt/standard/StandardDecryptor.html#getKeySizeInBytes()">getKeySizeInBytes</a></strong>()</code>&nbsp;</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/poifs/crypt/standard/StandardDecryptor.html#getLength()">getLength</a></strong>()</code>
<div class="block">Returns the length of the encytpted data that can be safely read with
 <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode)"><code>Decryptor.getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode)</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected static byte[]</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/poifs/crypt/standard/StandardDecryptor.html#truncateOrPad(byte[], int)">truncateOrPad</a></strong>(byte[]&nbsp;source,
             int&nbsp;length)</code>
<div class="block">Returns a byte array of the requested length,
  truncated or zero padded as needed.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>boolean</code></td>
<td class="colLast"><code><strong><a href="../../../../../../org/apache/poi/poifs/crypt/standard/StandardDecryptor.html#verifyPassword(java.lang.String)">verifyPassword</a></strong>(java.lang.String&nbsp;password)</code>&nbsp;</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_org.apache.poi.poifs.crypt.Decryptor">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;org.apache.poi.poifs.crypt.<a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html" title="class in org.apache.poi.poifs.crypt">Decryptor</a></h3>
<code><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getDataStream(org.apache.poi.poifs.filesystem.NPOIFSFileSystem)">getDataStream</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getDataStream(org.apache.poi.poifs.filesystem.POIFSFileSystem)">getDataStream</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getInstance(org.apache.poi.poifs.crypt.EncryptionInfo)">getInstance</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getIntegrityHmacKey()">getIntegrityHmacKey</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getIntegrityHmacValue()">getIntegrityHmacValue</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getSecretKey()">getSecretKey</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getVerifier()">getVerifier</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#setIntegrityHmacKey(byte[])">setIntegrityHmacKey</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#setIntegrityHmacValue(byte[])">setIntegrityHmacValue</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#setSecretKey(javax.crypto.SecretKey)">setSecretKey</a>, <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#setVerifier(byte[])">setVerifier</a></code></li>
</ul>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!--   -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.Object</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!--   -->
</a>
<h3>Constructor Detail</h3>
<a name="StandardDecryptor(org.apache.poi.poifs.crypt.EncryptionInfo)">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>StandardDecryptor</h4>
<pre>protected&nbsp;StandardDecryptor(<a href="../../../../../../org/apache/poi/poifs/crypt/EncryptionInfo.html" title="class in org.apache.poi.poifs.crypt">EncryptionInfo</a>&nbsp;info)</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!--   -->
</a>
<h3>Method Detail</h3>
<a name="verifyPassword(java.lang.String)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>verifyPassword</h4>
<pre>public&nbsp;boolean&nbsp;verifyPassword(java.lang.String&nbsp;password)</pre>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#verifyPassword(java.lang.String)">verifyPassword</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html" title="class in org.apache.poi.poifs.crypt">Decryptor</a></code></dd>
</dl>
</li>
</ul>
<a name="generateSecretKey(java.lang.String, org.apache.poi.poifs.crypt.EncryptionVerifier, int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>generateSecretKey</h4>
<pre>protected static&nbsp;javax.crypto.SecretKey&nbsp;generateSecretKey(java.lang.String&nbsp;password,
                                       <a href="../../../../../../org/apache/poi/poifs/crypt/EncryptionVerifier.html" title="class in org.apache.poi.poifs.crypt">EncryptionVerifier</a>&nbsp;ver,
                                       int&nbsp;keySize)</pre>
</li>
</ul>
<a name="fillAndXor(byte[], byte)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>fillAndXor</h4>
<pre>protected static&nbsp;byte[]&nbsp;fillAndXor(byte[]&nbsp;hash,
                byte&nbsp;fillByte)</pre>
</li>
</ul>
<a name="truncateOrPad(byte[], int)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>truncateOrPad</h4>
<pre>protected static&nbsp;byte[]&nbsp;truncateOrPad(byte[]&nbsp;source,
                   int&nbsp;length)</pre>
<div class="block">Returns a byte array of the requested length,
  truncated or zero padded as needed.
 Behaves like Arrays.copyOf in Java 1.6</div>
</li>
</ul>
<a name="getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode)">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDataStream</h4>
<pre>public&nbsp;java.io.InputStream&nbsp;getDataStream(<a href="../../../../../../org/apache/poi/poifs/filesystem/DirectoryNode.html" title="class in org.apache.poi.poifs.filesystem">DirectoryNode</a>&nbsp;dir)
                                  throws java.io.IOException</pre>
<div class="block"><strong>Description copied from class:&nbsp;<code><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode)">Decryptor</a></code></strong></div>
<div class="block">Return a stream with decrypted data.
 <p>
 Use <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getLength()"><code>Decryptor.getLength()</code></a> to get the size of that data that can be safely read from the stream.
 Just reading to the end of the input stream is not sufficient because there are
 normally padding bytes that must be discarded
 </p></div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode)">getDataStream</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html" title="class in org.apache.poi.poifs.crypt">Decryptor</a></code></dd>
<dt><span class="strong">Parameters:</span></dt><dd><code>dir</code> - the node to read from</dd>
<dt><span class="strong">Returns:</span></dt><dd>decrypted stream</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code>java.io.IOException</code></dd></dl>
</li>
</ul>
<a name="getLength()">
<!--   -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLength</h4>
<pre>public&nbsp;long&nbsp;getLength()</pre>
<div class="block"><strong>Description copied from class:&nbsp;<code><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getLength()">Decryptor</a></code></strong></div>
<div class="block">Returns the length of the encytpted data that can be safely read with
 <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode)"><code>Decryptor.getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode)</code></a>.
 Just reading to the end of the input stream is not sufficient because there are
 normally padding bytes that must be discarded

 <p>
    The length variable is initialized in <a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode)"><code>Decryptor.getDataStream(org.apache.poi.poifs.filesystem.DirectoryNode)</code></a>,
    an attempt to call getLength() prior to getDataStream() will result in IllegalStateException.
 </p></div>
<dl>
<dt><strong>Specified by:</strong></dt>
<dd><code><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html#getLength()">getLength</a></code>&nbsp;in class&nbsp;<code><a href="../../../../../../org/apache/poi/poifs/crypt/Decryptor.html" title="class in org.apache.poi.poifs.crypt">Decryptor</a></code></dd>
<dt><span class="strong">Returns:</span></dt><dd>length of the encrypted data</dd></dl>
</li>
</ul>
<a name="getKeySizeInBytes()">
<!--   -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getKeySizeInBytes</h4>
<pre>protected&nbsp;int&nbsp;getKeySizeInBytes()</pre>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!--   -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!--   -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/StandardDecryptor.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../../../index-all.html">Index</a></li>
<li><a href="../../../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../../../org/apache/poi/poifs/crypt/standard/EncryptionRecord.html" title="interface in org.apache.poi.poifs.crypt.standard"><span class="strong">PREV CLASS</span></a></li>
<li><a href="../../../../../../org/apache/poi/poifs/crypt/standard/StandardEncryptionHeader.html" title="class in org.apache.poi.poifs.crypt.standard"><span class="strong">NEXT CLASS</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../../../index.html?org/apache/poi/poifs/crypt/standard/StandardDecryptor.html" target="_top">FRAMES</a></li>
<li><a href="StandardDecryptor.html" target="_top">NO FRAMES</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
  allClassesLink = document.getElementById("allclasses_navbar_bottom");
  if(window==top) {
    allClassesLink.style.display = "block";
  }
  else {
    allClassesLink.style.display = "none";
  }
  //-->
</script>
</div>
<div>
<ul class="subNavList">
<li>SUMMARY:&nbsp;</li>
<li>NESTED&nbsp;|&nbsp;</li>
<li><a href="#fields_inherited_from_class_org.apache.poi.poifs.crypt.Decryptor">FIELD</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">METHOD</a></li>
</ul>
<ul class="subNavList">
<li>DETAIL:&nbsp;</li>
<li>FIELD&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">CONSTR</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">METHOD</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!--   -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
                <i>Copyright 2014 The Apache Software Foundation or
        its licensors, as applicable.</i>
            </small></p>
</body>
</html>
